package com.ruicar.afs.cloud.manage.outer.api.common.feign;

import com.alibaba.fastjson.JSONObject;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import com.ruicar.afs.cloud.manage.outer.api.common.dto.ApplyRecordConditionDto;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author: Lee
 * @date: 2020/5/11 19:39
 * @description:
 */
@FeignClient(name = "apply-file-feign", url = "${com.greatwall.services.manage.url}")
public interface ApplyFileFeign {
    @ApiOperation("附件上传后保存操作")
    @PostMapping(value = "upload/saveAttachmentFile")
    public IResponse saveAttachmentFile(@RequestParam("attachmentId") String attachmentId,
                                      @RequestParam("attachmentName") String attachmentName,
                                      @RequestParam("fileType") String fileType,
                                      @RequestParam("fileName") String fileName,
                                      @RequestParam("fileMd5") String fileMd5,
                                      @RequestParam("applyNo") String busiNo,
                                      @RequestParam("belongNo") String belongNo,
                                      @RequestHeader Map<String, String> headers);

    @ApiOperation("删除附件信息")
    @PostMapping(value = "upload/deleteFile")
    public IResponse deleteFile(@RequestBody JSONObject fileList, @RequestHeader Map<String, String> headers);


    @ApiOperation("更新附件信息")
    @PostMapping(value = "upload/updateFile")
    public IResponse updateFile(@RequestBody JSONObject fileParam, @RequestHeader Map<String, String> headers);

    @ApiOperation("旋转保存图片")
    @PostMapping(value = "uploadConvert/revolveFileConvert")
    public IResponse revolveFile(@RequestBody String revolveCondition, @RequestHeader Map<String, String> headers);

    @ApiOperation("根据业务场景和前端参数获取影像件类型")
    @PostMapping(value = "uploadConvert/getUploadListByGroupConvert")
    public IResponse getUploadListByGroup(@RequestBody String uploadCondition, @RequestHeader Map<String, String> headers);

    @ApiOperation("根据前端参数检查文件是否已上传完整")
    @PostMapping(value = "uploadConvert/checkFileConvert")
    public IResponse checkFile(@RequestBody String uploadCondition, @RequestHeader Map<String, String> headers);

}
